using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;
using Layout;
using System.Windows.Forms;

namespace CSDesktopUsiXMLRenderer
{
    abstract class UsiXMLLayoutManagerRenderer
    {
        public abstract String getValidElementName();
        public abstract ControlBox processRenderization(XmlNode element, ref Form mainForm);
		public abstract UsiXMLLayoutManagerRenderer getNextRenderer();
	
	    protected UsiXMLInterfaceRenderer usiXMLInterfaceRenderer = null;
	
	    public UsiXMLLayoutManagerRenderer(){
		    
	    }

        public void setInterfaceRenderer(UsiXMLInterfaceRenderer usiXMLInterfaceRenderer)
        {
            this.usiXMLInterfaceRenderer = usiXMLInterfaceRenderer;
        }

        public ControlBox renderElement(XmlNode element, ref Form mainForm)
        {
		
		    if (element.Name == this.getValidElementName()){
			    return this.processRenderization(element, ref mainForm);
		    }else{
			    return this.getNextRenderer().renderElement(element, ref mainForm);
		    }
        }
    }
}
